import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      component: () => import( './views/About.vue')
    },
    {
      path: '/app/layout',
      name: 'home1',
      component: () => import( './views/app/layout.vue'),
      children:[
        {
          path: '/app/index',
          name: 'index',
          component: () => import( './views/app/index.vue')
        },{
          path: '/app/cate',
          name: 'cate',
          component: () => import( './views/app/cate.vue')
        },{
          path: '/app/cart',
          name: 'cart',
          component: () => import( './views/app/cart.vue')
        },{
          path: '/app/my',
          name: 'my',
          component: () => import( './views/app/my.vue')
        },
      ]
    },
    {
      path: '/app/login',
      name: 'login',
      component: () => import( './views/app/login.vue')
    },
    {
      path: '/app/xq/:id',
      name: 'xq',
      component: () => import( './views/app/xq.vue')
    },
    {
      path: '/app/search',
      name: 'search',
      component: () => import( './views/app/search.vue')
    },
    //项目2号
    {
      path: '/app2/layout',
      name: 'home2',
      component: () => import( './views/app2/layout.vue'),
      children:[
        {
          path: '/app2/index',
          name: 'index2',
          component: () => import( './views/app2/index.vue')
        },{
          path: '/app2/cate',
          name: 'cate2',
          component: () => import( './views/app2/cate.vue')
        },{
          path: '/app2/cart',
          name: 'cart2',
          component: () => import( './views/app2/cart.vue')
        },{
          path: '/app2/my',
          name: 'my2',
          component: () => import( './views/app2/my.vue')
        },
      ]
    },
    {
      path: '/app2/login',
      name: 'login2',
      component: () => import( './views/app2/login.vue')
    },
    {
      path: '/app2/xq/:id',
      name: 'xq2',
      component: () => import( './views/app2/xq.vue')
    },
  ]
})
